﻿using PLCS.Domain.Shared.Equipments;

namespace PLCS.Application.Contracts.EquipmentApp.Dtos;

public class EquipmentDto : EntityDto<Guid>
{
    /// <summary>
    /// 工厂编码
    /// </summary>
    public string? SiteNo { get; set; } = "ZFGG";

    /// <summary>
    /// 车间编码
    /// </summary>
    public string? AreaNo { get; set; }

    /// <summary>
    /// 产线编码
    /// </summary>
    public string? PdLineNo { get; set; } = "XXZP";//Production line

    /// <summary>
    /// 设备名称
    /// </summary>
    public string EquName { get; set; }

    /// <summary>
    /// 设备名称MES
    /// </summary>
    public string EquName_Higher { get; set; }

    /// <summary>
    /// 设备名称PLC
    /// </summary>
    public string EquName_Lower { get; set; }

    /// <summary>
    /// 设备编号
    /// </summary>
    public string EquNum { get; set; }

    /// <summary>
    /// 在PLC中的序号
    /// </summary>
    public int Plc_Index { get; set; }

    public string PLCAddress { get; set; }
    public int Rack { get; set; }
    public int Slot { get; set; }
    public int DbNumber { get; set; }

    /// <summary>
    /// 当前任务ID
    /// </summary>
    public int CurrentTaskId { get; set; }

    /// <summary>
    /// 当前工位
    /// </summary>
    ///
    public string CurrentStation { get; set; }

    /// <summary>
    /// 当前坐标
    /// </summary>
    public int CurrentPos { get; set; }

    /// <summary>
    /// 最大坐标
    /// </summary>
    public int MaxPos { get; set; }

    /// <summary>
    /// 初始坐标
    /// </summary>
    public int InitPos { get; set; }

    /// <summary>
    /// 当前速度
    /// </summary>
    public int CurrentSpeed { get; set; }

    /// <summary>
    /// 当前托盘ID
    /// </summary>
    public string TrayId { get; set; }

    /// <summary>
    /// 空闲状态
    /// </summary>

    public DeviceStatus Status { get; set; }

    /// <summary>
    /// 设备锁定状态
    /// </summary>
    public YesNo IsLocked { get; set; }

    /// <summary>
    /// 空满位 状态
    /// </summary>
    public YesNo HaveStatus { get; set; }

    /// <summary>
    /// 故障代码
    /// </summary>

    public int ErrCode { get; set; }

    /// <summary>
    /// 设备类型
    /// </summary>
    public EquipmentType EquType { get; set; }

    /// <summary>
    /// 包含工位
    /// </summary>
    public string ContainStationNos { get; set; }

    /// <summary>
    /// 联机状态
    /// </summary>
    public OnlineMode OnlineStatus { get; set; }

    /// <summary>
    /// 是否使用
    /// </summary>
    public YesNo IsUse { get; set; } = YesNo.是;
}